package main

import (
	"fmt"
	"reflect"
)

func main() {
	nums := [10]int8{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
	fmt.Printf("数组的内存地址: %p \n", &nums)

	data := make([]int, 1, 3)
	fmt.Println("data==", data)
	fmt.Println(len(data))
	fmt.Println(cap(data))

	//data[0] = 1
	//
	//fmt.Println(data[0])

	//fmt.Printf("切片的内存地址: %p \n", &data)

	s6 := make([]int, 2, 4)
	fmt.Println(reflect.TypeOf(s6))
	i := append(s6, 1)
	fmt.Println(i)

	fmt.Println("S6:", len(s6))
	fmt.Println("S6:", cap(s6))

	s2 := []int{9, 8, 7, 6, 5}
	fmt.Println("s2 length: ", len(s2))
	fmt.Println("s2 capacity: ", cap(s2))

	ints := append(s2, i...)
	fmt.Println(ints)
	for item := range ints {
		fmt.Println(item, ints[item])
	}

	v1 := [][]int{{1, 2}, {3, 4}}
	fmt.Println(v1)
}
